﻿#ifndef CSEARCHLINEEDIT_H
#define CSEARCHLINEEDIT_H

#include "csearchbutton.h"

#include <QLineEdit>
#include <QKeyEvent>


class CSearchLineEdit : public QLineEdit
{
    Q_OBJECT
public:
    CSearchLineEdit(QWidget *parent = nullptr);

signals:
    //鼠标点击搜索按钮后触发搜索信号
    void sig_Search(const QString& text);
    void tabPressed(const QString& text);
    void spacePressed();
public slots:
    void handleSearch2(const QString& text);
private:
    //定义一个搜索按钮控件
    CSearchButton * m_pBtn = nullptr;
    void InitMenu();
protected:
    // virtual void contextMenuEvent(QContextMenuEvent * event) override;
    void keyPressEvent(QKeyEvent *event) override;

};
#endif // CSEARCHLINEEDIT_H
